<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>

        window.onload = function () {

            let num = 1;
            let myImg = document.getElementById("myImg");
            myImg.onclick = function () {
                num++
               if (num%2===0){
                   myImg.src = "../1.1.4img/2.jpg"
               }
               if (num%2===1){
                   myImg.src = "../1.1.4img/1.jpg"
               }
            }

        }

    </script>
</head>
<body>
<img src="../1.1.4img/1.jpg" alt="" id="myImg"><br>
<span>点击灯泡来电亮或熄灭这盏灯</span>
</body>
</html>